import requests

print("=========做post请求==============")
r=requests.post("http://httpbin.org/post")
print(r.text)
#结果
"""
{
  "args": {}, 
  "data": "", 
  "files": {}, 
  "form": {}, 
  "headers": {
    "Accept": "*/*", 
    "Accept-Encoding": "gzip, deflate", 
    "Content-Length": "0", 
    "Host": "httpbin.org", 
    "User-Agent": "python-requests/2.32.3", 
    "X-Amzn-Trace-Id": "Root=1-677debfa-2e7900a175795508142fd124"
  }, 
  "json": null, 
  "origin": "60.247.6.130", 
  "url": "http://httpbin.org/post"
}
"""
print("================================")

print("==========post带请求参数==========")
data01={
    "name":"jack",
    "age":22,
}
r01=requests.post("http://httpbin.org/post",data=data01)
print(r01.text)
#结果
"""
{
  "args": {}, 
  "data": "", 
  "files": {}, 
  "form": {
    "age": "22", 
    "name": "jack"
  }, 
  "headers": {
    "Accept": "*/*", 
    "Accept-Encoding": "gzip, deflate", 
    "Content-Length": "16", 
    "Content-Type": "application/x-www-form-urlencoded", 
    "Host": "httpbin.org", 
    "User-Agent": "python-requests/2.32.3", 
    "X-Amzn-Trace-Id": "Root=1-677debfb-07ee037a2d7a61b66d54e4c7"
  }, 
  "json": null, 
  "origin": "60.247.6.130", 
  "url": "http://httpbin.org/post"
}
"""
print("================================")
print("==========设置请求头==============")
print("================================")
print("================================")
print("================================")
print("================================")
print("================================")





